import { Heap } from "./heap";
import { defaultCompare, type ICompareFunc } from "./compare";

export class MinHeap<T> extends Heap<T> {
  protected compareFn: ICompareFunc<T>;
  constructor(compareFn = defaultCompare) {
    super();
    this.compareFn = compareFn;
  }

  findMinimum() {
    return this.isEmpty ? void 0 : this.heap[0];
  }
}
